import { NgModule, ModuleWithProviders } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule, FormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router';
import { HttpClientModule } from '@angular/common/http';
import { SharedModule } from 'app/shared/shared.module';
import { environment } from 'environments/environment';
import { NgZorroAntdModule } from 'ng-zorro-antd';
// me
import { SwaggerComponent } from './swagger.component';
import { SWAGGER_SERVICES } from './services';
import { SWAGGER_COMPONENTS } from './components';
import { MonacoEditorModule } from 'app/shared/editor';

const COMPONENTS = [
  SwaggerComponent
];

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    MonacoEditorModule.forRoot(),  
    ReactiveFormsModule,
    HttpClientModule,
    NgZorroAntdModule,
  ],
  declarations: [
    ...COMPONENTS,
    ...SWAGGER_COMPONENTS
  ],
  providers: [
    ...SWAGGER_SERVICES
  ],
  exports: [
    ...COMPONENTS
  ],
  entryComponents: [
  ]
})
export class SwaggerModule {
  static forRoot(): ModuleWithProviders {
    return {
      ngModule: SwaggerModule,
      providers: [
        ...SWAGGER_SERVICES
      ]
    };
  }
}

// export
export * from './services';